<template>
	<view class="setup-page">
		<navgatsVue :navigationMsg="navigationMsg"></navgatsVue>
		<view class="main">
			<view class="list">
				<view class="list-item" v-for="(item,index) in listData" :key="index" @click="itemClick(item)">
					<view class="text">
						{{item.text}}
					</view>
					<view class="right-icon">

					</view>
				</view>
			</view>
			<view class="outLogin" @click="tobacks()">
				退出登录
			</view>
		</view>
	</view>
</template>
<script>
	import navgatsVue from "../../../common/navgats/navgats.vue";
	export default {
		data() {
			return {
				navigationMsg: {
					title: "设置",
					bgColor: "#f6f6f6"
				},
				listData: [{
					id: 1,
					text: "个人信息"
				}, {
					id: 2,
					text: "账号与安全"
				}
				]
			}
		},
		components: {
			navgatsVue
		},
		methods: {
			itemClick(item) {
				console.log(item);
			},
			tobacks(){
				
				uni.showModal({
						title: '退出登录',
						content: '确定要退出登录吗？',
						success: function(res) {
						if (res.confirm) {
						    // 执行确认后的操作
							uni.clearStorageSync("token")
							
							uni.switchTab({
								url:"/pages/index/index"
							})
						} 
						else {
							// 执行取消后的操作
							
						}
					}
				})
				
				
			}
		}
	}
</script>
<style lang="scss" scoped>
	.setup-page {
		width: 100vw;
		height: 100vh;

		.main {
			width: 100%;
			height: calc(100vh - 180rpx);
			background-color: #f6f6f6;
			display: flex;
			flex-direction: column;
			align-items: center;

			.list {
				width: 100%;
				height: calc(100% - 180rpx);
				display: flex;
				flex-direction: column;
				align-items: center;
				margin-top: 20rpx;

				.list-item {
					width: 90%;
					height: 100rpx;
					background-color: white;
					display: flex;
					align-items: center;
					justify-content: space-between;

					.text {
						font-size: 30rpx;
						margin-left: 30rpx;
					}

					.right-icon {
						width: 20rpx;
						height: 20rpx;
						background-image: url("/static/my/right_ccc.svg");
						background-size: contain;
						margin-right: 30rpx;
					}
				}

				.list-item:nth-child(1) {
					border-radius: 20rpx;
				}

				.list-item:nth-child(2) {
					margin-top: 20rpx;
					border-radius: 20rpx;
				}

				.list-item:nth-child(6) {
					border-radius: 20rpx;
				}
			}

			.outLogin {
				width: 90%;
				height: 100rpx;
				background-color: #ffffff;
				color: #b1b1b1;
				border-radius: 50rpx;
				text-align: center;
				line-height: 100rpx;
				margin-top: 30rpx;
				font-weight: bold;
				font-size: 34rpx;
			}
		}
	}
</style>